<script>
//单击事件
function authRule_NodeClick(e, treeId, treeNode) {
    $('#sc-menuText').val(treeNode.name);
    $('input[name="pid"]').val(treeNode.id);
}
</script>
<div class="bjui-pageContent">
        <form action="{:U('AuthRule/add')}" data-toggle="validate" data-reload-navtab="true" data-alertmsg="false">
        <table class="table">
            <tbody>
                <tr>
                    <th>上级菜单：</th>
                    <td>
                        <input type="text" id="sc-menuText" value="{$info.ptitle}" data-toggle="selectztree" size="18" data-tree="#authRuleTree" placeholder="不填写为顶级菜单" readonly>
                        <input type="hidden" name="pid" value="{$info.pid}">
                        <input type="hidden" name="id" value="{$info.id}">
                        <ul id="authRuleTree" class="ztree hide" data-toggle="ztree" data-on-click="authRule_NodeClick">
                            <li data-id="0">顶级菜单</li>
                            <foreach name="pmenu" item="v">
                                <li data-id="{$v.id}" data-pid="{$v.pid}">{$v.title}</li>
                            </foreach>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <th>菜单名称：</th>
                    <td>
                        <input type="text" name="title" value="{$info.title}" data-rule="名称:required">
                        <span class="red">*</span>
                    </td>
                </tr>
                <tr>
                    <th>URL地址：</th>
                    <td>
                        <input type="text" name="name" value="{$info.name}">
                    </td>
                </tr>
                <tr>
                    <th>图标：</th>
                    <td>
                        <input type="text" name="icon" value="{$info.icon}" placeholder="Font Awesome图标"> 
                        不带前缀 fa-, 如 fa-user => user
                    </td>
                </tr>
                <tr>
                    <th>类型：</th>
                    <td>
                        <select name="menutype" data-toggle="selectpicker" data-width="100">
                            <option value="1" <eq name="info.menutype" value="1">selected</eq>>分组</option>
                            <option value="2" <eq name="info.menutype" value="2">selected</eq>>菜单</option>
                            <option value="3" <eq name="info.menutype" value="3">selected</eq>>节点</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>排序：</th>
                    <td>
                        <input type="text" name="sort" value="{$info.sort}" data-toggle="spinner" size="5" data-rule="digits">
                    </td>
                </tr>
                <tr>
                    <th>状态：</th>
                    <td>
                        <input type="radio" name="status" value="1" data-toggle="icheck" data-label="启用" 
                        <eq name="info.status" value="1">checked</eq>>&nbsp;
                        <input type="radio" name="status" value="0" data-toggle="icheck" data-label="禁用"
                        <eq name="info.status" value="0">checked</eq>>
                    </td>
                </tr>
            </tbody>
        </table>    
        </form>
</div> 

<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">取消</button></li>
        <li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
    </ul>
</div>
